package com.example.demo.设计模式.代理模式.动态代理.JDK代理;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @description:
 * @projectName:demo
 * @see:设计模式.代理模式.动态代理.JDK代理
 * @author:袁成龙
 * @createTime:2020/10/12 19:13
 * @version:1.0
 */
public class Test01 implements InvocationHandler {

    private Object object;

    public Test01(Object object) {
        this.object = object;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

        System.out.println("===========之前操作===========");

        Object invoke = method.invoke(object);

        System.out.println("===========之后操作===========");

        return invoke;
    }
}